<template lang="html">
  <div class="m-detail-list">
    <ul>
      <li v-if="length !== 0">
        {{ length }}款套餐
      </li>
      <li v-else>
        暂无套餐数据
      </li>
      <item
        v-for="(item,idx) in list"
        :key="idx"
        :meta="item"
      />
    </ul>
  </div>
</template>

<script>
import Item from './item.vue'
export default {
  components: {
    Item
  },
  props: {
    list: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data () {
    return {
      length: 0
    }
  },
  mounted () {
    this.length = this.list.filter(item => item.photos.length).length
  }
}
</script>
